Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@sap/node-jwt
Advanced tools
JSON Web Token (JWT) offline validation for Node with current binaries
This project contains the JWT binding for Node.js. It also includes the native libraries to run on Windows/Linux. If you need another platforms, please create a SAP support ticket to BC-XS-SEC. The library is supposed to be used for on-premise systems, because for cloud scenarios there is another solution.
Supported platforms: Windows | Linux | MacOS Supported architectures: x64 on supported platforms. Please see also section dependencies for Node.js version.
This standard example is from http://jwt.io
// you can either load a HMAC key for signatures with HSxxx
v.setSecret("secret"); // load HMAC key
v.setBase64Secret("c2VjcmV0"); // load a Base64 encoded HMAC key
// or you can load a PEM encoded X509 certificate for signatures with RSxxx
v.loadPEM("MIICozCCAYsCCAogFQcmCUcJMA0GCSqGSIb3DQEBCwUAMBQ...."); // load X509 public certificate OR public key for RSA signature validation
// check the token signature and validity
v.checkToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ");
console.log("Test JWT for Node.js");
if (v.getErrorDescription() !== "") {
// error handling
console.log("Error in JWT: " + v.getErrorDescription());
} else {
// in case of success, retrieve the payload
console.log("JWT Payload : " + v.getPayload());
}
From your project directory, run (see below for requirements):
$ var jwt = require('@sap/node-jwt');
Released versions
npm install @sap/node-jwt
node-gyp
or any compiler (e.g. Visual Studio on Windows). The source code and binding.gyp is part of this project in case of errors.The standard error for signature operations is the situation, that the signature is not valid. This error is typical and you should handle it carefully! and not as fatal error or assert. If you think, it must work, but it does not, then you can trace the native functions. SAPSSOEXT library allows you to set the environment variables:
set SAP_EXT_TRC=stdout
set SAP_EXT_TRL=3
If you run your application in CloudFoundry or XSA then you can define environment variables with client command tool cf / xs, see https://docs.run.pivotal.io/devguide/deploy-apps/manifest.html#env-block
In cf landscapes you can then cf logs and you will see trace from JWT validation
In order to configure the sap NPM registry you need to issue the following command:
npm install @sap/node-jwt
FAQs
JWT validation library for Node.js
The npm package @sap/node-jwt receives a total of 180 weekly downloads. As such, @sap/node-jwt popularity was classified as not popular.
We found that @sap/node-jwt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.